Q: I don't get my mail on a NeXT computer, but people with NeXT computers sometimes send me messages with NeXT Mail attachments. How can I decipher these using Unix mail?\
\
A: You can decode the mail by hand if you want to. Note that this format is likely to change in a future release. Follow these steps in a shell in order to read the message:\
\
1. At the prompt in the
\b mail
\b0 utility, type\
\f1 s
\f0\i
\f1 foo
\f0\i0 \
to save the message as a file named
\i foo
\i0 .\
\
2. Open the file
\i foo
\i0 with your favorite editor. After the mail header information is a line with this format:\
\f1 begin 0
\f0
\f1\i tarfile
\f0\i0 \
Remember the name that appears in place of
\i tarfile
\i0 , because
\b uudecode
\b0 will create a file with this name.\
\
3. Decode the file (this creates
\i tarfile
\i0 , leaving
\i foo
\i0 intact):\
\f1 uudecode
\f0
\f1\i foo
\f0\i0 \
\
4. Change the permission on
\i tarfile
\i0 and move it to the desired place. The new filename must end with the suffix ".Z". (Note that
\i tarfile
\i0 begins with a period so it will be invisible with a normal
\b ls
\b0 command; use
\b ls -a
\b0 instead if you want to verify that it's there.)\
\f1 chmod 666
\f0
\f1\i tarfile
\f0\i0 \
\f1 mv
\i tarfile
\i0
\i mailmsg.Z
\f0\i0 \
\
5. Uncompress it (this will create a file called
\i mailmsg
\i0 and remove
\i mailmsg.Z
\i0 ): \
\f1 uncompress
\i mailmsg.Z
\f0\i0 \
\
6. For the final step,
\i mailmsg
\i0 should be in a directory by itself so that when the message is unparsed the various files are easy to find. \
\f1 mkdir
\i newdir
\i0 \
mv
\i mailmsg newdir
\i0 \
cd
\i newdir
\i0 \
tar xvf
\i mailmsg
\i0 \
\f0 \
The
\b tar
\b0 command will show you the files it has unparsed. One of them is called
\i index.rtf
\i0 . This is the body of the message in Rich Text Format (RTF). The rest of the files and directories are the attachments. Hopefully they are files that can be opened on the receiving system. If you have an editor that can read RTF files, use it to open
\i index.rtf
\i0 . It will have the body of the text. There will be no text if just an attachment was sent. \
\
The rest of this NextAnswers entry discusses what to do if your editor can't read RTF files.\
\
Open
\i index.rtf
\i0 with your editor. Much of the text in this file is RTF formatting. The curly braces and words starting with `\\' are RTF directives. You can ignore them for the most part; they introduce formatting and text style information. The only interesting directive is
\i \\attachment#
\i0 . It is the placeholder for an attachment that has been placed in the directory. The group
\i \{/attachment# filename \}
\i0 is the information for the attachment.\
\
In the following example, the
\pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\fc0 the line
\pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\fc0 In the following example, there is only text. The English sentences are the words you are interested in:\